import Vue from 'vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import routes from './routes'
import App from './App.vue'

import './static/style/main.css'
import './static/font-awesome/css/font-awesome.min.css'
/* eslint-disable*/
import layer from './static/plugin/layer/layer.js'
import './static/plugin/layer/need/layer.css'

Vue.use(VueRouter)
Vue.use(VueResource)

const router = new VueRouter({
    mode: 'hash',
    routes
})

if (typeof Object.assign !== 'function') {
    Object.assign = function(target) {
        'use strict'
        if (target == null) {
            throw new TypeError('Cannot convert undefined or null to object')
        }

        target = Object(target)
        for (var index = 1; index < arguments.length; index++) {
            var source = arguments[index]
            if (source != null) {
                for (var key in source) {
                    if (Object.prototype.hasOwnProperty.call(source, key)) {
                        target[key] = source[key]
                    }
                }
            }
        }
        return target
    }
}
/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    render: h => h(App)
})